﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LinqExtender;
using $safeprojectname$.Objects;
using LinqExtender.Configuration;
using LinqExtender.Interfaces;

namespace $safeprojectname$
{
    public class $objectname$Provider : Query<$objectname$Object>
    {
        public $objectname$Provider()
        {
            Extender
                .Settings
                    .For<$objectname$Object>()
                        .Begin
                            .Property(x => x.Id).MarkAsUnique
                        .End
           .InstantiateIn(this);
        }

        protected override bool AddItem(IBucket bucket)
        {
            // true means  succcess and false means failed , it will also
            // raise an error in OnError event.
            return true;
        }

        protected override bool RemoveItem(IBucket bucket)
        {
            // TODO : Implement data access logic
            return true;
        }

        protected override bool UpdateItem(IBucket bucket)
        {
            // TODO : write your update logic here
            return true;
        }
        
	    protected override $objectname$Object GetItem(IBucket bucket)
        {
            return null;
        }

        protected override void SelectItem(IBucket bucket, LinqExtender.Interfaces.IModify<$objectname$Object> items)
        {
              // TODO :  populate collection on basis of bucket object.
        }
    }
}
